import unittest


class Demo1TestCase(unittest.TestCase):
    def test_01(self):
        print('test01')

    def test_02(self):
        print('test02')


class Demo2TestCase(unittest.TestCase):
    def test_a(self):
        print('test_a')

    def test_b(self):
        print('test_b')


if __name__ == '__main__':
    # 普通方式
    # unittest.main(verbosity=2)
    # suite addTests测试套件
    test = [
        Demo1TestCase('test_02'),
        Demo2TestCase('test_b')
    ]
    suite = unittest.TestSuite()
    suite.addTests(test)
    # runner 测试执行器
    runner = unittest.TextTestRunner(verbosity=2)
    runner.run(suite)
